<!DOCTYPE html>
<html>
<html xmlns:th="http://www.thymeleaf.org"/>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta name="format-detection" content="telephone=no, address=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style">
    <title></title>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
    <link href="https://cdn.bootcss.com/jquery-mobile/1.4.5/jquery.mobile.theme.css" rel="stylesheet">

    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>

    <script src="/js/jquerymobile_popup.js"></script>


    <script type="text/javascript">
        function subMeetingGrab() {
            // 非空校验
            var remark = $("#remark").val();
            if (remark.length < 1) {
                openPopup('描述不能为空', '提示', undefined, true, undefined, 'error', 'cn');
                return;
            }
            var objs = $("#meetingGrabFormId").serialize();
            var encryptUid = $("#encryptUid").val();
            $.ajax({
                type: "POST",
                url: "/meetingGrab/addMeetingGrab",
                data: objs,
                success: function (msg) {
                    if (msg.code == "4003") {
                        openPopup('非法请求参数,无法提交请求', '提示', undefined, true, undefined, 'error', 'cn');
                    } else if (msg.code == "4004") {
                        openPopup('注意提交参数（不支持表情和长度）', '提示', undefined, true, undefined, 'error', 'cn');
                    } else if (msg.code == "4006") {
                        // openPopup('重复提交', '提示', undefined, true, undefined, 'error', 'cn');
                        alert("重复提交");
                        window.location.href = "/page/meetingGrabList?encryptUid=" + encryptUid;
                    }else if (msg.code == "2000") {
                        openPopup('会议抢单成功', '提示', undefined, true, undefined, 'error', 'cn');
                        window.location.href = "/page/meetingGrabList?encryptUid=" + encryptUid;
                    }
                }
            });

        }


    </script>
</head>
<body>

<div data-role="page" id="pageDetail">
    <div style="padding:0px;background-color: #4E90C7;width: 100%;height:40px;line-height:40px;font-size:18px;text-align: center;cursor: pointer;"
         data-role="none">
        <div style="width: 100%;float: left;color: white;" id="one_tab">
            抢单

        </div>


    </div>

    <form id="meetingGrabFormId">
        <div id="one" class="ui-body-d ui-content" style="padding:0;display: block;width: 100%;">
            <font style="padding:10px 10px 10px 15px;display: block;color: #777777;">请填写会议抢单相关信息</font>
            <div style="width: 100%;background-color: white;padding:10px 0 10px 0;">

                <input type="text" name="pid" id="pid" th:value="${pid}" readonly>
                <input type="text" name="encryptUid" id="encryptUid" th:value="${encryptUid}" readonly>
                <div style="padding-right:15px;padding-left:15px">
                    <label for="remark" class="font-label">备注(选填，100字以内)</label>
                    <textarea name="remark" id="remark" placeholder="请输入会议备注" maxlength="100"
                              class="font-blue input-lightblue" style="box-shadow: none;"></textarea>
                </div>
                <div style="padding-right:15px;padding-left:15px">
                    <input type="button" value="进行抢单" onclick="subMeetingGrab()" id="btnId"/>
                </div>

            </div>
        </div>
    </form>


</body>

</html>
